package com.txy.filter;

import com.alibaba.dubbo.common.extension.Activate;
import com.alibaba.dubbo.rpc.*;

@Activate
public class TransportIPFilter implements Filter {
    @Override
    public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
        String realIp = RpcContext.getContext().getAttachment("realIp");
        System.out.println("当前服务{"+RpcContext.getContext().getLocalAddressString()+"}  客户端{"+realIp+"}");
        return invoker.invoke(invocation);
    }
}
